package com.jiangjiang.eshop.membership.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiangjiang.eshop.membership.dao.UserDetailMapper;
import com.jiangjiang.eshop.membership.domain.UserAccountEntity;
import com.jiangjiang.eshop.membership.domain.UserDetailEntity;
import com.jiangjiang.eshop.membership.dto.UserAccountDTO;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserDetailService
 * @Description TODO
 * @Author jhw
 * @Date 2021/8/21 12:20
 * @Version 1.0
 **/
@Service
public class UserDetailService extends ServiceImpl<UserDetailMapper, UserDetailEntity> {

    /**
     * 根据用户账号id查询用户详细信息
     * @param userAccountId 用户账号id
     * @return 查询结果
     */
    public UserDetailEntity queryDetailByUserAccountId(Long userAccountId) {
        LambdaQueryWrapper<UserDetailEntity> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(UserDetailEntity::getUserAccountId, userAccountId);
        return this.getOne(wrapper);
    }
}
